package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.CrmHtddDetailMapper;
import com.ruoyi.quartz.domain.CrmHtddDetail;
import com.ruoyi.quartz.service.ICrmHtddDetailService;

/**
 * 合同订单详情Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-14
 */
@Service
public class CrmHtddDetailServiceImpl implements ICrmHtddDetailService 
{
    @Autowired
    private CrmHtddDetailMapper crmHtddDetailMapper;

    /**
     * 查询合同订单详情
     * 
     * @param htNumber 合同订单详情主键
     * @return 合同订单详情
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public CrmHtddDetail selectCrmHtddDetailByHtNumber(String htNumber)
    {
        return crmHtddDetailMapper.selectCrmHtddDetailByHtNumber(htNumber);
    }

    /**
     * 查询合同订单详情列表
     * 
     * @param crmHtddDetail 合同订单详情
     * @return 合同订单详情
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<CrmHtddDetail> selectCrmHtddDetailList(CrmHtddDetail crmHtddDetail)
    {
        return crmHtddDetailMapper.selectCrmHtddDetailList(crmHtddDetail);
    }

    /**
     * 新增合同订单详情
     * 
     * @param crmHtddDetail 合同订单详情
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertCrmHtddDetail(CrmHtddDetail crmHtddDetail)
    {
        return crmHtddDetailMapper.insertCrmHtddDetail(crmHtddDetail);
    }

    /**
     * 修改合同订单详情
     * 
     * @param crmHtddDetail 合同订单详情
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateCrmHtddDetail(CrmHtddDetail crmHtddDetail)
    {
        return crmHtddDetailMapper.updateCrmHtddDetail(crmHtddDetail);
    }

    /**
     * 批量删除合同订单详情
     * 
     * @param htNumbers 需要删除的合同订单详情主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteCrmHtddDetailByHtNumbers(String[] htNumbers)
    {
        return crmHtddDetailMapper.deleteCrmHtddDetailByHtNumbers(htNumbers);
    }

    /**
     * 删除合同订单详情信息
     * 
     * @param htNumber 合同订单详情主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteCrmHtddDetailByHtNumber(String htNumber) {
        return crmHtddDetailMapper.deleteCrmHtddDetailByHtNumber(htNumber);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int clearHtddDetail() {
        return crmHtddDetailMapper.clearHtddDetail();
    }
}
